package com.xunlai.infra.permission.common.exception;

import java.io.Serial;
import java.io.Serializable;

/**
 * @author liang
 * @date 2022/11/30 11:00
 */
public class PermissionBusinessException extends Exception implements Serializable {

    protected final Integer code;

    protected final String msg;

    @Serial
    private static final long serialVersionUID = -3730413839858952513L;


    public PermissionBusinessException(Integer code, String msg) {
        super(msg);
        this.code = code;
        this.msg = msg;
    }

    public PermissionBusinessException(ExceptionCodeEnum codeEnum) {
        this(codeEnum.getCode(),codeEnum.getDesc());
    }

    public Integer getCode() {
        return code;
    }

    public String getMsg() {
        return msg;
    }
}
